package com.ljx.blog.oss.controller;

import com.ljx.blog.common.domain.vo.resp.ApiResult;
import com.ljx.blog.oss.domain.vo.req.UploadReq;
import com.ljx.blog.oss.domain.vo.resp.UploadResp;
import com.ljx.blog.oss.service.OssService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-10-24  22:14
 */
@Api(tags = "OSS接口")
@RestController
@RequestMapping("/oss")
public class OssController {

    @Autowired
    private OssService ossService;

    @ApiOperation("上传")
    @PostMapping("/upload")
    public ApiResult<UploadResp> upload(UploadReq req){
        return ApiResult.success(ossService.upload(req));
    }
}
